<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <script src="../../js/load.js"></script>
</head>

<body>
<div id="container">
    <div id="formcontainer">
        <form class="layui-form layui-form-pane" id="editform" lay-filter="editform">
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">ip</label>
                        <div class="layui-input-block">
                            <input type="text" name="host" autocomplete="off" class="layui-input required">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">端口</label>
                        <div class="layui-input-block">
                            <input type="text" name="port" autocomplete="off" value="22" class="layui-input required">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">账号</label>
                        <div class="layui-input-block">
                            <input type="text" name="username" autocomplete="off" value="root" class="layui-input required">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">密码</label>
                        <div class="layui-input-block">
                            <input type="text" name="password" autocomplete="off" class="layui-input required">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row" style="display:none">
                <div class="layui-col-xs12">
                    <div class="layui-form-item">
                        <label class="layui-form-label">operate</label>
                        <div class="layui-input-block">
                            <input type="text" name="operate" value="connect" autocomplete="off" >
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div id="opcontainer">
        <button class="layui-btn" onclick="HandleConnect()">连接</button>
    </div>
</div>
</body>
</html>
<script>
    $(function () {

    })

    function HandleConnect() {
        var fromData = GetFormData('editform');
        if(fromData!='undefined'){
            window.localStorage.setItem("connectData", fromData);
            window.location.href = GetLocalRootPath()+"pages/webssh/index.html";
        }
    }
</script>